//
//  HttpManager.h
//  QuanJieShopProject
//
//  Created by apple on 2018/1/30.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "QJNetworkManager.h"

@interface HttpManager : QJNetworkManager

//单例
+ (HttpManager *)shareHttpManager;

//GET请求(请求体为json格式)
/*
 *   get    :请求方式为get
 *   url    :数据请求的地址
 *   json   :请求体为json字符串格式
 *   hiden  :是否隐藏加载动画
 *   success:请求成功的回调
 *   failure:请求失败的回调
 */
- (void)getJsonWithUrl:(NSString *)url parameter:(NSString *)json hiddenHUD:(BOOL)hiden HUDTitle:(NSString *)title success:(QJNetworkManagerBlock)success failure:(QJNetworkManagerBlock)failure;
//GET请求(请求体为dict格式)
/*
 *   get    :请求方式为get
 *   url    :数据请求的地址
 *   dict   :请求体为dict键值对格式
 *   hiden  :是否隐藏加载动画
 *   success:请求成功的回调
 *   failure:请求失败的回调
 */
- (void)getDictWithUrl:(NSString *)url parameter:(NSDictionary *)dict hiddenHUD:(BOOL)hiden HUDTitle:(NSString *)title success:(QJNetworkManagerBlock)success failure:(QJNetworkManagerBlock)failure;

//POST请求(请求体为json格式)
/*
 *   post   :请求方式为post
 *   url    :数据请求的地址
 *   json   :请求体为json字符串格式
 *   hiden  :是否隐藏加载动画
 *   success:请求成功的回调
 *   failure:请求失败的回调
 */
- (void)postJsonWithUrl:(NSString *)url parameter:(NSString *)json hiddenHUD:(BOOL)hiden HUDTitle:(NSString *)title success:(QJNetworkManagerBlock)success failure:(QJNetworkManagerBlock)failure;
//POST请求(请求体为dict格式)
/*
 *   post   :请求方式为get
 *   url    :数据请求的地址
 *   dict   :请求体为dict键值对格式
 *   hiden  :是否隐藏加载动画
 *   success:请求成功的回调
 *   failure:请求失败的回调
 */
- (void)postDictWithUrl:(NSString *)url parameter:(NSDictionary *)dict hiddenHUD:(BOOL)hiden HUDTitle:(NSString *)title success:(QJNetworkManagerBlock)success failure:(QJNetworkManagerBlock)failure;

//图片上传采用post方式
//图片上传不带有图片的名字
- (void)postImageWithUrl:(NSString *)url parameter:(NSDictionary *)dict hiddeHUD:(BOOL)hiden HUDTitle:(NSString *)title success:(QJNetworkManagerBlock)success failure:(QJNetworkManagerBlock)failure;
//图片上传带有图片文件
- (void)postImagefileWithUrl:(NSString *)url parameter:(NSDictionary *)dict withImageFile:(UIImage *)image hiddenHUD:(BOOL)hiden HUDTitle:(NSString *)title success:(QJNetworkManagerBlock)success failure:(QJNetworkManagerBlock)failure;

@end
